﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using wpf4gp.Helpers;

namespace wpf4gp.ViewModels
{

    /// <summary>
    /// Base class for a view model of a window
    /// </summary>
    public abstract class BaseWindowViewModel : NotificationObject
    {



        #region IsLoading

        private bool _isLoading = false;

        /// <summary>
        /// True if any long operation is running
        /// </summary>
        public bool IsLoading
        {
            get
            {
                return _isLoading;
            }
            set
            {
                if (_isLoading != value)
                {
                    _isLoading = value;
                    RaisePropertyChanged(() => IsLoading);
                }
            }
        }


        #endregion


        #region DialogResult

        private bool? _dialogResult = null;

        /// <summary>
        /// True if any long operation is running
        /// </summary>
        public bool? DialogResult
        {
            get
            {
                return _dialogResult;
            }
            set
            {
                if (_dialogResult != value)
                {
                    _dialogResult = value;
                    RaisePropertyChanged(() => DialogResult);
                }
            }
        }


        #endregion

    
    }
}
